﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetSerieFacturaByProveedorID')
	BEGIN
		DROP  Procedure  GetSerieFacturaByProveedorID
	END

GO

CREATE Procedure GetSerieFacturaByProveedorID

	(
		@idProveedor int
	)


AS
begin
SELECT  distinct dbo.Factura.Serie

FROM     dbo.OrdenCompra INNER JOIN
         dbo.Factura ON dbo.OrdenCompra.IdOrdenCompra = dbo.Factura.IdOrdenCompra
where    dbo.OrdenCompra.IdProveedor=@idProveedor  
end

GO


GRANT EXEC ON GetSerieFacturaByProveedorID TO PUBLIC

GO


